/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nus.application.web.review;

import com.nus.application.ejb.user.ConferenceEjbLocal;
import com.nus.application.web.base.BaseAction;
import com.nus.application.web.review.form.ReviewResultForm;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;

/**
 *
 * @author robin.foe
 */
public class ReviewResultMaintenance extends BaseAction{
    
    @Inject
    ConferenceEjbLocal conferenceEjb;
     
    public String doList(){
        Map<String, Object> filters = new HashMap<String,Object>();
        this.form.setFullListSize(conferenceEjb.getTotalCountConferenceAuthorByAuthor( super.getCurrentLoginUser().getId() , filters));
        this.form.setPageNumber(super.getPage());
        this.getForm().setConferenceAuthors(
                conferenceEjb.paginateConferenceAuthorByAuthor(super.getCurrentLoginUser().getId() , form.calculateStartRow(super.getPage()), form.getObjectsPerPage(), null, false, filters)
                );

        return SUCCESS;
    }
    
    
    public String doPreview(){
        com.nus.dataaccess.dao.conference.ConferenceAuthor conferenceAuthor = conferenceEjb.retrieveConferenceAuthor(this.getForm().getConferenceAuthor().getId());
        this.getForm().setConferenceAuthor(conferenceAuthor);
        return SUCCESS;
    }
    
    private ReviewResultForm form = new ReviewResultForm();
    public ReviewResultForm getForm() {return form;}
    public void setForm(ReviewResultForm form) {this.form = form;}
    
    
}
